from pathlib import Path
from readfile import CsvRead, ExcelRead, ZipRead

def get_students_list(filepath,target_filename = None):
    file_suffix = Path(filepath).suffix
    if file_suffix == '.csv':
        students_list = CsvRead(filepath).read()
    if file_suffix == '.xlsx':
        students_list = ExcelRead(filepath).read()
    elif file_suffix =='.zip':
        students_list = ZipRead(filepath, target_filename).read()
    return students_list